import Vue from 'vue'
import VueRouter from 'vue-router'
import cache from "@/plugins/cache";
import {userinfo} from "@/constants/userConstant";
Vue.use(VueRouter)

const routes = [
  {
    path:"/",
    component:()=>import("@/views/login/index.vue")
  },
  {
    path: "/home",
    component:()=>import("@/views/home/home.vue"),
    children:[
      {
        path: "/overview",
        component:()=>import("@/views/overview/index.vue")
      },
      {
        path: "/video",
        component:()=>import("@/views/video/index.vue")
      },
      {
        path: "/algor",
        component:()=>import("@/views/algor/index.vue")
      },
      {
        path: "/control",
        component:()=>import("@/views/algor/control.vue")
      },
      {
        path: "/sys",
        component:()=>import("@/views/sys/index.vue")
      },
      {
        path: "/device",
        component:()=>import("@/views/device/device.vue")
      },
      {
        path: "/gb",
        component:()=>import("@/views/gb/gbinfo.vue")
      },
      {
        path: "/menu",
        component:()=>import("@/views/menu/menuv2.vue")
      },
      {
        path: "/user",
        component:()=>import("@/views/user/user.vue")
      },
      {
        path: "/role",
        component:()=>import("@/views/role/role.vue")
      },
      {
        path: "/devops",
        component:()=>import("@/views/devpost/devpost.vue")
      },{
        path: "/warn",
        component:()=>import("@/views/warning/warn.vue")
      },{
        path: '/dept',
        component:()=>import("@/views/dept/dept.vue")
      },{
        path: '/loginLog',
        component:()=>import("@/views/log/loginLog.vue")
      }
      ,{
        path: '/operlog',
        component:()=>import("@/views/log/operLog.vue")
      }
      ,{
        path: '/canvas',
        component:()=>import("@/views/video/canvas-demo.vue")
      },{
        path: '/are',
        component:()=>import("@/views/are/railwayovervire.vue")
      },
      {
        path: '/imageDetection',
        component:()=>import("@/views/imageDetection/index.vue")
      },
      {
        path: '/sampleItem',
        component:()=>import("@/views/imageDetection/sampleItem.vue")
      },
      {
        path: '/test',
        component:()=>import("@/views/overview/test.vue")
      }

    ]
  }

]
const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})



// 全局前置守卫


export default router
